import utils from '@/utils'
import store from '@/store'

export function setupRouterGuard(router) {
  createPageGuard(router);
}

function createPageGuard(router) {
  router.beforeEach((to, from, next) => {
    // console.log(to)
    // console.log(from)
    
    utils.setPageTitle(to.meta.title);
    store.dispatch("app/setActivePath", to.path);
    next();
  });
}

